package com.example.demo.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.example.demo.entity.Mark;
import com.example.demo.mapper.MarkMapper;
import com.example.demo.service.MarkService;

@Service
@Transactional
public class MarkServiceImpl implements MarkService{

	@Autowired
	private MarkMapper markMapper;
	
	private List<Mark> marklist;
	
	private Mark mark1;
	
	@Override
	public int addMark(Mark mark) {
		// TODO Auto-generated method stub
		return markMapper.insertMark(mark);
	}

	@Override
	public int delMark(Integer kid) {
		// TODO Auto-generated method stub
		return markMapper.deleteMark(kid);
	}

	@Override
	public int updateMark(Mark mark) {
		// TODO Auto-generated method stub
		return markMapper.updateMark(mark);
	}

	@Override
	public List<Mark> selectMark() {
		// TODO Auto-generated method stub
		marklist=new ArrayList<Mark>();
		marklist=markMapper.selectMark();
		return marklist;
	}

	@Override
	public Mark selectOneMark(Integer kid) {
		// TODO Auto-generated method stub
		mark1= new Mark();
		mark1= markMapper.selectOneMark(kid); 
		return mark1;
	}

}
